/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.zaahir.assignment2.PLK;

import junit.framework.Assert;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import za.ac.cput.zaahir.assignment2.PLK.Config.AppConfig;
import za.ac.cput.zaahir.assignment2.PLK.Impl.Subject;
import za.ac.cput.zaahir.assignment2.PLK.Impl.Course;
import org.springframework.context.ApplicationContext;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author Nashief
 */ 

public class University {

     private static ApplicationContext act;

    private static Course c ;
    private static Subject s;
    
    public University() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception { 
        act=new AnnotationConfigApplicationContext(AppConfig.class); 

        c=act.getBean(Course.class);
        s=act.getBean(Subject.class);
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }
    @Test 
    public void testUniversity() 
    {

        
       Assert.assertEquals("TP3", c.subjects());
    }
}
